<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Day01 - Hello</title>
</head>
<body>
<%
	for (int i = 0; i < 10; i++) {
		out.println("Hello World " + i + "<br/>");
	}
%>

<%= "abcd" %><br/>
<% out.println("abcd"); %><br/>

<%-- 여기는 localVar 선언 위: <%= localVar %><br/> --%>

<% String localVar = "local variable"; %>

여기는 memberVar 선언 위: <%= memberVar %><br/>

<%!
	String memberVar = "member variable";

	private int sum(int start, int end) {
		int sum = 0;
		for (int i = start; i <= end; i++) {
			sum += i;
		}
		return sum;
	}
%>

Local Variable: <%= localVar %><br/>
Member Variable: <%= memberVar %><br/>
<br/>
Sum of 1 to 10: <%= sum(1, 10) %><br/>

<%-- 이곳은 JSP 주석입니다. --%>
<!-- 이곳은 html 주석입니다. -->

<c:if test=”${1+1==2}”>
Always true.
</c:if>

<%
if (1+1 == 2) {
	out.println("Always true.");
}
%>

</body>
</html>